const {DataTypes, db,fn} = require("../db");
db.define('dept', {
    id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true},
    tenantId: {type: DataTypes.INTEGER,},
    name: {type: DataTypes.STRING,},
    code: {type: DataTypes.STRING,},
    pid: {type: DataTypes.INTEGER,},
    manId: {type: DataTypes.INTEGER,},
    phone: {type: DataTypes.INTEGER,},
}, {
    tableName: 'dept',
    timestamps: false,
    indexes: [{
        unique: true,
        name: '部门名称不能重复',
        fields: ['tenantId', 'name']
    }]
});